pv-qemu 2/10: Add a QEMU machine type for paravirt guests
authorKeir Fraser <keir@xensource.com>
Thu, 25 Oct 2007 13:35:04 +0000 (14:35 +0100)
committerKeir Fraser <keir@xensource.com>
Thu, 25 Oct 2007 13:35:04 +0000 (14:35 +0100)
commit3bc128ebcfa8358e19f5de8ab0707ecd17cca85a
tree15ebd4756af419f0c3ef05d66fb0245ce9e960f2
parent5bfefa417d59a4f7ec8a5ebff21f8fd2709eaaea
pv-qemu 2/10: Add a QEMU machine type for paravirt guests

This patch adds a paravirt machine type to QEMU. This can be requested
by passing the arg '-M xenpv' to qemu-dm. Aside from -d, and
-domain-name, the only other args that are processed are the VNC / SDL
graphics related args. Any others will be ignored. A tweak to
helper2.c was made to stop it setting up a file handler watch when
there are no CPUs registered.

The paravirt machine is in hw/xen_machine_pv.c and registers an
instance of the xenfb class, integrating it with the QEMU event loop
and key/mouse handlers. A couple of methods were adding to xenfb.h to
allow direct access to the file handles for xenstore & the event
channel.

The vfbif.py device controller is modified to launch qemu-dm instead
of the old xen-vncfb / sdlfb daemons.

When receiving framebuffer updates from the guest, the update has to
be copied into QEMU's copy of the framebuffer. This is because QEMU
stores the framebuffer in the format that is native to the SDL
display, or VNC client. This is not neccessarily the same as the guest
framebuffer which is always 32bpp. If there is an exact depth match we
use memcpy for speed, but in the non-matching case we have to fallback
to slow code to convert pixel formats. It fully supports all features
of the paravirt framebuffer including the choice between absolute &
relative pointers. The overall VIRT memory image size is about same as
old xen-vncfb, but the resident memory size is a little increased due
to copy of the framebuffer & some QEMU static state overhead. Most of
this is shared across QEMU processes.

To avoid both moving the xenfb.c and making changes to it in the same
patch, this just uses a Makefile hack to link against the xenfb.o from
the tools/xenfb/ directory. This will be removed in the following
patch.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
tools/ioemu/Makefile.target
tools/ioemu/hw/xen_machine_pv.c [new file with mode: 0644]
tools/ioemu/target-i386-dm/helper2.c
tools/ioemu/vl.c
tools/ioemu/vl.h
tools/python/xen/xend/server/vfbif.py
tools/xenfb/xenfb.c
tools/xenfb/xenfb.h